VERSION 5.00 Begin VB.Form frmbtnMaker AutoRedraw = -1 'True BorderStyle = 3 'Fixed Dialog Caption = "Button Collection" ClientHeight = 4800 ClientLeft = 45 ClientTop = 300 ClientWidth = 6360 BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Icon = "frmbtnMaker.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 4800 ScaleWidth = 6360 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton cmdMakeCode Caption = "Generate Code" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 465 Left = 2310 TabIndex = 14 Top = 3390 Width = 1395 End Begin VB.CommandButton cmdDelete Caption = "Delete" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 465 Left = 3030 TabIndex = 13 Top = 2880 Width = 1395 End Begin VB.CommandButton cmdAdd Caption = "Add" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 465 Left = 1590 TabIndex = 12 Top = 2880 Width = 1395 End Begin VB.PictureBox Picture1 BackColor = &H00808080& BorderStyle = 0 'None BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 2775 Left = 1590 ScaleHeight = 2775 ScaleWidth = 4725 TabIndex = 6 Top = 60 Width = 4725 Begin VB.CommandButton cmdSize BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 0 TabIndex = 7 Top = 0 Width = 1425 End End Begin VB.TextBox txtName BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 0 TabIndex = 5 Top = 300 Width = 1490 End Begin VB.TextBox txtCap BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 0 TabIndex = 3 Top = 840 Width = 1490 End Begin VB.CommandButton cmdPrev Caption = "Preview" Default = -1 'True BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 405 Left = 2220 TabIndex = 1 Top = 4320 Width = 1695 End Begin VB.PictureBox pSp AutoRedraw = -1 'True BorderStyle = 0 'None Height = 315 Left = 2310 ScaleHeight = 315 ScaleWidth = 1485 TabIndex = 0 Top = 3990 Width = 1485 End Begin VB.Label l AutoSize = -1 'True Caption = "Height" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Index = 5 Left = 0 TabIndex = 11 Top = 2730 Width = 465 End Begin VB.Label l AutoSize = -1 'True Caption = "Width" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Index = 4 Left = 0 TabIndex = 10 Top = 2220 Width = 420 End Begin VB.Label l AutoSize = -1 'True Caption = "Top" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Index = 3 Left = 0 TabIndex = 9 Top = 1680 Width = 285 End Begin VB.Label l AutoSize = -1 'True Caption = "Left" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Index = 2 Left = 0 TabIndex = 8 Top = 1170 Width = 270 End Begin VB.Label l AutoSize = -1 'True Caption = "Name" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Index = 0 Left = 0 TabIndex = 4 Top = 60 Width = 420 End Begin VB.Label l AutoSize = -1 'True Caption = "Caption" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Index = 1 Left = 0 TabIndex = 2 Top = 600 Width = 540 End Attribute VB_Name = "frmbtnMaker" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private WithEvents pSpin As Spin Attribute pSpin.VB_VarHelpID = -1 Private WithEvents s_Left As Spin Attribute s_Left.VB_VarHelpID = -1 Private WithEvents s_Top As Spin Attribute s_Top.VB_VarHelpID = -1 Private WithEvents s_Width As Spin Attribute s_Width.VB_VarHelpID = -1 Private WithEvents s_Height As Spin Attribute s_Height.VB_VarHelpID = -1 '--------------------------------' Dim m_ColBtn As ButtonMngr Private Sub cmdAdd_Click() Static int_NumCreat As Integer int_NumCreat = int_NumCreat + 1 m_ColBtn.AddButton "cmdNew" & int_NumCreat, "New Btn" & int_NumCreat, 0, 0, 1000, 400, BackColor, Nothing, Nothing pSpin.MaxValue = m_ColBtn.Count pSpin.MinValue = 1 pSpin.Value = 1 pSpin.Redraw End Sub Private Sub cmdDelete_Click() If pSpin.Value = 0 Then Exit Sub m_ColBtn.Remove pSpin.Value If pSpin.MaxValue = 1 Then pSpin.MinValue = 0 pSpin.Value = 0 pSpin.MaxValue = 0 End If End Sub Private Sub cmdMakeCode_Click() Clipboard.Clear Clipboard.SetText BtnMngrToCode(m_ColBtn) End Sub Private Sub Form_Load() Set m_ColBtn = New ButtonMngr Set pSpin = New Spin Set s_Left = New Spin Set s_Top = New Spin Set s_Width = New Spin Set s_Height = New Spin pSpin.ChangeRate = 1 s_Left.Enabled = True s_Top.Enabled = True s_Width.Enabled = True s_Height.Enabled = True Set s_Left.Parent = Me Set s_Top.Parent = Me Set s_Width.Parent = Me Set s_Height.Parent = Me s_Left.Left = l(2).Left s_Left.Top = l(2).Top + l(2).Height s_Left.Height = 300 s_Left.Width = 1490 s_Left.MinValue = -1000 s_Top.Left = l(3).Left s_Top.Top = l(3).Top + l(3).Height s_Top.Height = 300 s_Top.Width = 1490 s_Top.MinValue = -400 s_Width.Left = l(4).Left s_Width.Top = l(4).Top + l(4).Height s_Width.Height = 300 s_Width.Width = 1490 s_Width.MaxValue = 2750 s_Height.Left = l(5).Left s_Height.Top = l(5).Top + l(5).Height s_Height.Height = 300 s_Height.Width = 1490 s_Height.MaxValue = 2750 s_Height.ChangeRate = Screen.TwipsPerPixelY s_Left.MaxValue = Picture1.Width - 1000 s_Top.MaxValue = Picture1.Height - 400 s_Width.ChangeRate = Screen.TwipsPerPixelY s_Left.ChangeRate = Screen.TwipsPerPixelX * 2 s_Top.ChangeRate = Screen.TwipsPerPixelY * 2 pSpin.Enabled = True pSpin.Height = pSp.ScaleHeight pSpin.Width = pSp.ScaleWidth pSpin.MaxValue = m_ColBtn.Count Set pSpin.Parent = pSp pSpin.Redraw s_Left.Redraw s_Top.Redraw s_Width.Redraw s_Height.Redraw End Sub Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) s_Left.MouseDown Button, X, Y s_Top.MouseDown Button, X, Y s_Width.MouseDown Button, X, Y s_Height.MouseDown Button, X, Y End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) s_Left.MouseMove Button, X, Y s_Top.MouseMove Button, X, Y s_Width.MouseMove Button, X, Y s_Height.MouseMove Button, X, Y End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) s_Left.MouseUp Button, X, Y s_Top.MouseUp Button, X, Y s_Width.MouseUp Button, X, Y s_Height.MouseUp Button, X, Y End Sub Private Sub pSp_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) pSpin.MouseDown Button, X, Y End Sub Private Sub pSp_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) pSpin.MouseMove Button, X, Y End Sub Private Sub pSp_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) pSpin.MouseUp Button, X, Y End Sub Private Sub pSpin_Changed(PropertyName As String) If PropertyName = "Value" Then If pSpin.Value = 0 Then Exit Sub With m_ColBtn.Buttons(pSpin.Value) cmdSize.Visible = False txtCap = .Caption txtName = .Name s_Height = .Height s_Width = .Width s_Left = .Left s_Top = .Top cmdSize.Visible = True End With End If End Sub Private Sub s_Height_Changed(PropertyName As String) Static InProc As Boolean If InProc Then Exit Sub InProc = True If PropertyName = "Value" Then If pSpin = 0 Then s_Height = 0: InProc = False: Exit Sub End If cmdSize.Height = s_Height On Error Resume Next m_ColBtn.Buttons(pSpin.Value).Height = s_Height InProc = False End Sub Private Sub s_Left_Changed(PropertyName As String) Static InProc As Boolean If InProc Then Exit Sub InProc = True If PropertyName = "Value" Then If pSpin = 0 Then s_Left = 0: InProc = False: Exit Sub End If cmdSize.Left = s_Left On Error Resume Next m_ColBtn.Buttons(pSpin.Value).Left = s_Left InProc = False End Sub Private Sub s_Top_Changed(PropertyName As String) Static InProc As Boolean If InProc Then Exit Sub InProc = True If PropertyName = "Value" Then If pSpin.Value = 0 Then s_Top.Value = 0: InProc = False: Exit Sub End If cmdSize.Top = s_Top.Value On Error Resume Next m_ColBtn.Buttons(pSpin.Value).Top = s_Top InProc = False End Sub Private Sub s_Width_Changed(PropertyName As String) Static InProc As Boolean If InProc Then Exit Sub InProc = True If PropertyName = "Value" Then If pSpin = 0 Then s_Width = 0: InProc = False: Exit Sub End If cmdSize.Width = s_Width On Error Resume Next m_ColBtn.Buttons(pSpin.Value).Width = s_Width InProc = False End Sub Private Sub txtCap_Change() If pSpin.Value = 0 Then Exit Sub cmdSize.Caption = txtCap m_ColBtn.Buttons(pSpin.Value).Caption = txtCap End Sub Private Sub txtName_Change() If pSpin.Value = 0 Then Exit Sub m_ColBtn.Buttons(pSpin.Value).Name = txtName End Sub